<?php

/*
 * 操作员新增
 */

namespace Admin\Func;

class FuncLog {
    var $db;
    var $AppID;

    var $ISError;
    var $ErrorCode;
    var $ErrorMessage;
    var $OperParadesc;

    public function __construct($AppID,$ISError,$ErrorCode,$ErrorMessage,$OperParadesc) {
        $this->db  = new \Think\Model();

        $this->OperatorID = addslashes($AppID);
        $this->ISError = addslashes($ISError);
        $this->ErrorCode = addslashes($ErrorCode);
        $this->ErrorMessage = addslashes($ErrorMessage);
        $this->OperParadesc = addslashes($OperParadesc);
    }

    /*
     * 执行
     */

    public function execute() {
        $vflag = true;
        $OperID = I('OperID');
        $OperTimeStamp = I('OperID');
        if ($this->validate()===true) {

            $sql = <<<EOD
INSERT INTO t_lz_sys_log(
                    OperatorID,
                    OperatorName,
                    LoginPasswd,
                    OperID,
                    OperDate
                        )VALUES(
                    '$this->OperatorID',
                    '$this->OperatorName',
                    '$this->LoginPasswd',
                    '$OperID',
                    NOW()
                        );
EOD;
     
            //$rst = $model->query($sql);
            $this->rst = $this->db->execute($sql);
            if ($this->rst === false) {
                $this->errmsg = $this->db->getDbError();
                $vflag = false;
            } else {
                $vflag = true;
            }
        } else {
           
            $vflag = false;
        }
        return $vflag;
    }

    public function getRst() {
        return $this->rst;
    }

}
